package com.jeff.cloud.provideruser.controller;


import com.jeff.cloud.provideruser.dao.UserRepository;
import com.jeff.cloud.provideruser.dao.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 创建controller
 * @author: jeff
 * @date: 2021/8/6 11:11
 */
@RestController
public class UserController {
    @Autowired
    private UserRepository userRepository;

    // getMapping == @RequestMapping(method=RequestMethod.GET)
    @GetMapping("/{id}")
    public User findById(@PathVariable Long id){
        User findOne = this.userRepository.findOne(id);
        return findOne;
    }


}
